home *** CD-ROM | disk | FTP | other *** search
Wrap
/* File: Video.h Copyright: © 1984-1994 by Apple Computer, Inc. All rights reserved. Version: Universal Interfaces 2.0a3 ETO #16, MPW prerelease. Friday, November 11, 1994. Bugs?: If you find a problem with this file, send the file and version information (from above) and the problem description to: Internet: apple.bugs@applelink.apple.com AppleLink: APPLE.BUGS */ #ifndef __VIDEO__ #define __VIDEO__ #ifndef __QUICKDRAW__ #include <Quickdraw.h> #endif /* #include <Types.h> */ /* #include <ConditionalMacros.h> */ /* #include <MixedMode.h> */ /* #include <QuickdrawText.h> */ #ifdef __cplusplus extern "C" { #endif #if GENERATINGPOWERPC #pragma options align=mac68k #endif #ifdef __CFM68K__ #pragma lib_export on #endif enum { mBaseOffset = 1, /*Id of mBaseOffset.*/ mRowBytes = 2, /*Video sResource parameter Id's */ mBounds = 3, /*Video sResource parameter Id's */ mVersion = 4, /*Video sResource parameter Id's */ mHRes = 5, /*Video sResource parameter Id's */ mVRes = 6, /*Video sResource parameter Id's */ mPixelType = 7, /*Video sResource parameter Id's */ mPixelSize = 8, /*Video sResource parameter Id's */ mCmpCount = 9, /*Video sResource parameter Id's */ mCmpSize = 10, /*Video sResource parameter Id's */ mPlaneBytes = 11, /*Video sResource parameter Id's */ mVertRefRate = 14, /*Video sResource parameter Id's */ mVidParams = 1, /*Video parameter block id.*/ mTable = 2, /*Offset to the table.*/ mPageCnt = 3, /*Number of pages*/ mDevType = 4, /*Device Type*/ oneBitMode = 128, /*Id of OneBitMode Parameter list.*/ twoBitMode = 129, /*Id of TwoBitMode Parameter list.*/ fourBitMode = 130, /*Id of FourBitMode Parameter list.*/ eightBitMode = 131 /*Id of EightBitMode Parameter list.*/ }; enum { sixteenBitMode = 132, /*Id of SixteenBitMode Parameter list.*/ thirtyTwoBitMode = 133, /*Id of ThirtyTwoBitMode Parameter list.*/ firstVidMode = 128, /*The new, better way to do the above. */ secondVidMode = 129, /* QuickDraw only supports six video */ thirdVidMode = 130, /* at this time. */ fourthVidMode = 131, fifthVidMode = 132, sixthVidMode = 133, spGammaDir = 64, spVidNamesDir = 65 }; /* csTimingFormat values in VDTimingInfo */ /* look in the declaration rom for timing info */ enum { kDeclROMtables = 'decl' }; /* Timing mode constants for Display Manager MultiMode support Corresponding .h equates are in Video.h .a equates are in Video.a .r equates are in DepVideoEqu.r */ enum { timingInvalid = 0, /* Unknown timing… force user to confirm.*/ timingApple12 = 130, /* 512x384 (60 Hz) Rubik timing.*/ timingApple12x = 135, /* 560x384 (60 Hz) Rubik-560 timing.*/ timingApple13 = 140, /* 640x480 (67 Hz) HR timing.*/ timingApple13x = 145, /* 640x400 (67 Hz) HR-400 timing.*/ timingAppleVGA = 150, /* 640x480 (60 Hz) VGA timing.*/ timingApple15 = 160, /* 640x870 (75 Hz) FPD timing.*/ timingApple15x = 165, /* 640x818 (75 Hz) FPD-818 timing.*/ timingApple16 = 170, /* 832x624 (75 Hz) GoldFish timing.*/ timingAppleSVGA = 180, /* 800x600 (56 Hz) SVGA timing.*/ timingApple1Ka = 190, /* 1024x768 (60 Hz) VESA 1K-60Hz timing.*/ timingApple1Kb = 200, /* 1024x768 (70 Hz) VESA 1K-70Hz timing.*/ timingApple19 = 210, /* 1024x768 (75 Hz) Apple 19" RGB.*/ timingApple21 = 220, /* 1152x870 (75 Hz) Apple 21" RGB.*/ timingAppleNTSC_ST = 230, /* 512x384 (60 Hz, interlaced, non-convolved).*/ timingAppleNTSC_FF = 232, /* 640x480 (60 Hz, interlaced, non-convolved).*/ timingAppleNTSC_STconv = 234, /* 512x384 (60 Hz, interlaced, convolved).*/ timingAppleNTSC_FFconv = 236, /* 640x480 (60 Hz, interlaced, convolved).*/ timingApplePAL_ST = 238, /* 640x480 (50 Hz, interlaced, non-convolved).*/ timingApplePAL_FF = 240, /* 768x576 (50 Hz, interlaced, non-convolved).*/ timingApplePAL_STconv = 242, /* 640x480 (50 Hz, interlaced, non-convolved).*/ timingApplePAL_FFconv = 244 /* 768x576 (50 Hz, interlaced, non-convolved).*/ }; /* csConnectFlags values in VDDisplayConnectInfo */ enum { kAllModesValid = 0, /* All modes not trimmed by primary init are good close enough to try */ kAllModesSafe = 1, /* All modes not trimmed by primary init are know to be safe */ kReportsTagging = 2, /* Can detect tagged displays (to identify smart monitors) */ kHasDirectConnection = 3, /* True implies that driver can talk directly to device (e.g. serial data link via sense lines) */ kIsMonoDev = 4, /* Says whether there’s an RGB (0) or Monochrome (1) connection. */ kUncertainConnection = 5, /* There may not be a display (no sense lines?). */ kReservedConnectionBit = 6, /* Reserved for now */ kReportsDDCConnection = 7, /* Card can do ddc (set kHasDirectConnect && kHasDDCConnect if you actually found a ddc display). */ kHasDDCConnection = 8 /* Card has ddc connect now. */ }; /* csDisplayType values in VDDisplayConnectInfo */ enum { kUnknownConnect = 1, /* Not sure how we’ll use this, but seems like a good idea. */ kPanelConnect = 2, /* For use with fixed-in-place LCD panels. */ kPanelTFTConnect = 2, /* Alias for kPanelConnect */ kFixedModeCRTConnect = 3, /* For use with fixed-mode (i.e., very limited range) displays. */ kMultiModeCRT1Connect = 4, /* 320x200 maybe, 12" maybe, 13" (default), 16" certain, 19" maybe, 21" maybe */ kMultiModeCRT2Connect = 5, /* 320x200 maybe, 12" maybe, 13" certain, 16" (default), 19" certain, 21" maybe */ kMultiModeCRT3Connect = 6, /* 320x200 maybe, 12" maybe, 13" certain, 16" certain, 19" default, 21" certain */ kMultiModeCRT4Connect = 7, /* Expansion to large multi mode (not yet used) */ kModelessConnect = 8, /* Expansion to modeless model (not yet used) */ kFullPageConnect = 9, /* 640x818 (to get 8bpp in 512K case) and 640x870 (these two only) */ kVGAConnect = 10, /* 640x480 VGA default -- question everything else */ kNTSCConnect = 11, /* NTSC ST (default), FF, STconv, FFconv */ kPALConnect = 12, /* PAL ST (default), FF, STconv, FFconv */ kHRConnect = 13, /* 640x400 (to get 8bpp in 256K case) and 640x480 (these two only) */ kPanelFSTNConnect = 14 /* For use with fixed-in-place LCD FSTN (aka “Supertwist”) panels */ }; /* csTimingFlags values in VDTimingInfoRec */ enum { kModeValid = 0, /* Says that this mode should NOT be trimmed. */ kModeSafe = 1, /* This mode does not need confirmation */ kModeDefault = 2, /* This is the default mode for this type of connection */ kModeShowNow = 3, /* This mode should always be shown (even though it may require a confirm) */ kModeNotResize = 4 /* This mode should not be used to resize the display (eg. mode selects a different connector on card) */ }; enum { /* Control Codes */ cscReset = 0, cscKillIO = 1, cscSetMode = 2, cscSetEntries = 3, cscSetGamma = 4, cscGrayPage = 5, cscGrayScreen = 5, cscSetGray = 6, cscSetInterrupt = 7, cscDirectSetEntries = 8, cscSetDefaultMode = 9, cscSwitchMode = 10, cscSetSync = 11, cscSavePreferredConfiguration = 16 }; enum { /* Status Codes */ cscGetMode = 2, cscGetEntries = 3, cscGetPageCnt = 4, cscGetPages = 4, /* This is what C&D 2 calls it. */ cscGetPageBase = 5, cscGetBaseAddr = 5, /* This is what C&D 2 calls it. */ cscGetGray = 6, cscGetInterrupt = 7, cscGetGamma = 8, cscGetDefaultMode = 9, cscGetCurMode = 10, cscGetSync = 11, cscGetConnection = 12, /* Return information about the connection to the display */ cscGetModeTiming = 13, /* Return timing info for a mode */ cscGetModeBaseAddress = 14, /* Return base address information about a particular mode */ cscGetScanProc = 15, /* QuickTime scan chasing routine */ cscGetPreferredConfiguration = 16, cscGetNextResolution = 17, cscGetVideoParameters = 18, cscGetGammaList = 19 }; /* Bit definitions for the Get/Set Sync call*/ enum { kHorizontalSyncDisableBit = 0, kVerticalSyncDisableBit = 1, kCompositeSyncDisableBit = 2, kSyncOnRedEnableBit = 3, kSyncOnGreenEnableBit = 4, kSyncOnBlueEnableBit = 5, kHorizontalSyncMask = 0x01, kVerticalSyncMask = 0x02, kCompositeSyncMask = 0x04, kDPMSSyncMask = 0x7, kSyncOnRedMask = 0x08, kSyncOnGreenMask = 0x10, kSyncOnBlueMask = 0x20, kSyncOnMask = 0x38 }; struct VPBlock { long vpBaseOffset; /*Offset to page zero of video RAM (From minorBaseOS).*/ short vpRowBytes; /*Width of each row of video memory.*/ Rect vpBounds; /*BoundsRect for the video display (gives dimensions).*/ short vpVersion; /*PixelMap version number.*/ short vpPackType; long vpPackSize; long vpHRes; /*Horizontal resolution of the device (pixels per inch).*/ long vpVRes; /*Vertical resolution of the device (pixels per inch).*/ short vpPixelType; /*Defines the pixel type.*/ short vpPixelSize; /*Number of bits in pixel.*/ short vpCmpCount; /*Number of components in pixel.*/ short vpCmpSize; /*Number of bits per component*/ long vpPlaneBytes; /*Offset from one plane to the next.*/ }; typedef struct VPBlock VPBlock; typedef VPBlock *VPBlockPtr; struct VDEntryRecord { Ptr csTable; /*(long) pointer to color table entry=value, r,g,b:INTEGER*/ }; typedef struct VDEntryRecord VDEntryRecord; typedef VDEntryRecord *VDEntRecPtr; /* Parm block for SetGray control call */ struct VDGrayRecord { Boolean csMode; /*Same as GDDevType value (0=mono, 1=color)*/ SInt8 filler; }; typedef struct VDGrayRecord VDGrayRecord; typedef VDGrayRecord *VDGrayPtr; /* Parm block for SetEntries control call */ struct VDSetEntryRecord { ColorSpec *csTable; /*Pointer to an array of color specs*/ short csStart; /*Which spec in array to start with, or -1*/ short csCount; /*Number of color spec entries to set*/ }; typedef struct VDSetEntryRecord VDSetEntryRecord; typedef VDSetEntryRecord *VDSetEntryPtr; /* Parm block for SetGamma control call */ struct VDGammaRecord { Ptr csGTable; /*pointer to gamma table*/ }; typedef struct VDGammaRecord VDGammaRecord; typedef VDGammaRecord *VDGamRecPtr; struct VDSwitchInfoRec { unsigned short csMode; /*(word) mode depth*/ unsigned long csData; /*(long) functional sResource of mode*/ unsigned short csPage; /*(word) page to switch in*/ Ptr csBaseAddr; /*(long) base address of page (return value)*/ unsigned long csReserved; /*(long) Reserved (set to 0) */ }; typedef struct VDSwitchInfoRec VDSwitchInfoRec; typedef VDSwitchInfoRec *VDSwitchInfoPtr; struct VDTimingInfoRec { unsigned long csTimingMode; /* LONGINT - (long) timing mode (a la InitGDevice) */ unsigned long csTimingReserved; /* LONGINT - (long) reserved */ unsigned long csTimingFormat; /* LONGINT - (long) what format is the timing info */ unsigned long csTimingData; /* LONGINT - (long) data supplied by driver */ unsigned long csTimingFlags; /* LONGINT - (long) mode within device */ }; typedef struct VDTimingInfoRec VDTimingInfoRec; typedef VDTimingInfoRec *VDTimingInfoPtr; struct VDDisplayConnectInfoRec { unsigned short csDisplayType; /* INTEGER - (word) Type of display connected */ unsigned short csConnectTagged; /* INTEGER - (word) Display is currently "it" (tagged to identify component) */ unsigned long csConnectFlags; /* LONGINT - (long) tell us about the connection */ unsigned long csDisplayComponent; /* LONGINT - (long) if the card has a direct connection to the display, it returns the display component here (FUTURE) */ unsigned long csConnectReserved; /* LONGINT - (long) reserved */ }; typedef struct VDDisplayConnectInfoRec VDDisplayConnectInfoRec; typedef VDDisplayConnectInfoRec *VDDisplayConnectInfoPtr; struct VDPageInfo { short csMode; /*(word) mode within device*/ long csData; /*(long) data supplied by driver*/ short csPage; /*(word) page to switch in*/ Ptr csBaseAddr; /*(long) base address of page*/ }; typedef struct VDPageInfo VDPageInfo; typedef VDPageInfo *VDPgInfoPtr; struct VDSizeInfo { short csHSize; /*(word) desired/returned h size*/ short csHPos; /*(word) desired/returned h position*/ short csVSize; /*(word) desired/returned v size*/ short csVPos; /*(word) desired/returned v position*/ }; typedef struct VDSizeInfo VDSizeInfo; typedef VDSizeInfo *VDSzInfoPtr; struct VDSettings { short csParamCnt; /*(word) number of params*/ short csBrightMax; /*(word) max brightness*/ short csBrightDef; /*(word) default brightness*/ short csBrightVal; /*(word) current brightness*/ short csCntrstMax; /*(word) max contrast*/ short csCntrstDef; /*(word) default contrast*/ short csCntrstVal; /*(word) current contrast*/ short csTintMax; /*(word) max tint*/ short csTintDef; /*(word) default tint*/ short csTintVal; /*(word) current tint*/ short csHueMax; /*(word) max hue*/ short csHueDef; /*(word) default hue*/ short csHueVal; /*(word) current hue*/ short csHorizDef; /*(word) default horizontal*/ short csHorizVal; /*(word) current horizontal*/ short csHorizMax; /*(word) max horizontal*/ short csVertDef; /*(word) default vertical*/ short csVertVal; /*(word) current vertical*/ short csVertMax; /*(word) max vertical*/ }; typedef struct VDSettings VDSettings; typedef VDSettings *VDSettingsPtr; typedef unsigned long DisplayModeID; typedef unsigned long VideoDeviceType; typedef unsigned short DepthMode; typedef unsigned long GammaTableID; enum { kFirstDepthMode = 128, kSecondDepthMode = 129, kThirdDepthMode = 130, kFourthDepthMode = 131, kFifthDepthMode = 132, kSixthDepthMode = 133 }; struct VDResolutionInfoRec { DisplayModeID csPreviousDisplayModeID; /* ID of the previous resolution in a chain */ DisplayModeID csDisplayModeID; /* ID of the next resolution */ unsigned long csHorizontalPixels; /* # of pixels in a horizontal line */ unsigned long csVerticalLines; /* # of lines in a screen */ Fixed csRefreshRate; /* Vertical Refresh Rate in Hz */ DepthMode csMaxDepthMode; /* 0x80-based number representing max bit depth */ unsigned long csReserved; /* Reserved */ unsigned long csReserved1; /* Reserved */ }; typedef struct VDResolutionInfoRec VDResolutionInfoRec; typedef VDResolutionInfoRec *VDResolutionInfoPtr; struct VDVideoParametersInfoRec { DisplayModeID csDisplayModeID; /* the ID of the resolution we want info on */ DepthMode csDepthMode; /* The bit depth we want the info on (0x80 based) */ VPBlockPtr csVPBlockPtr; /* Pointer to a video parameter block */ unsigned long csPageCount; /* Number of pages supported by the resolution */ VideoDeviceType csDeviceType; /* Device Type: Direct, Fixed or CLUT; */ unsigned long csReserved; /* Reserved */ }; typedef struct VDVideoParametersInfoRec VDVideoParametersInfoRec; typedef VDVideoParametersInfoRec *VDVideoParametersInfoPtr; struct VDGammaInfoRec { GammaTableID csLastGammaID; /* the ID of the previous gamma table */ GammaTableID csNextGammaID; /* the ID of the next gamma table */ Ptr csGammaPtr; /* Ptr to a gamma table data */ unsigned long csReserved; /* Reserved */ }; typedef struct VDGammaInfoRec VDGammaInfoRec; typedef VDGammaInfoRec *VDGammaInfoPtr; struct VDDefMode { UInt8 csID; SInt8 filler1; }; typedef struct VDDefMode VDDefMode; typedef VDDefMode *VDDefModePtr; struct VDSyncInfoRec { UInt8 csMode; UInt8 csFlags; }; typedef struct VDSyncInfoRec VDSyncInfoRec; typedef VDSyncInfoRec *VDSyncInfoPtr; #ifdef __CFM68K__ #pragma lib_export off #endif #if GENERATINGPOWERPC #pragma options align=reset #endif #ifdef __cplusplus } #endif #endif /* __VIDEO__ */